<%--
  Created by IntelliJ IDEA.
  User: Alta Y
  Date: 2019/9/28
  Time: 15:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" media="screen" href="${pageContext.request.contextPath}/css/base.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/fonts/iconfont.css">
    <link rel="stylesheet" type="text/css" media="screen" href="${pageContext.request.contextPath}/css/main.css" />

    <script src="${pageContext.request.contextPath}/js/main.js"></script>


    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<%--    <link rel="stylesheet" href="css/font.css">--%>
    <link rel="stylesheet" href="css/xadmin.css">
    <link rel="stylesheet" type="text/css" media="screen" href="${pageContext.request.contextPath}/css/main.css" />

    <link rel="stylesheet" href="css/admin.css">
    <script src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>

    <script src="js/jquery.min.js"></script>
</head>
<body>
<div class="head">
    <div class="top"></div>
    <div class="w head_center">
        <div class="head_center_left">
                    <img class="logo" src="${pageContext.request.contextPath}/images/交易.png">
            <div class="title">
                <h1>煤炭贸易电商平台</h1>
                <h2>COAL TRADING E-COMMERCE PLATFORM </h2>
            </div>
        </div>
        <div class="head_center_right">
            <div class="login_bt">
                <p>登录</p>
            </div>
        </div>
    </div>
</div>
<div class="banner">
    <div class="banner_imgdiv">
        <div class="w">
            <div class="banner_textdiv">
                <span class="span_top"></span>
                <span class="span_bottom"></span>
                <P>智能管理，公正验收</P>
            </div>

            <!-- 登陆卡片 -->
            <div class="logindiv">
                <!-- 登陆表单 -->
                <form action="login" method="post">
                    <p class="login_title">登录<span> LOGIN IN</span></p>

                    <div class="close_logindiv" ><img src="${pageContext.request.contextPath}/images/关 闭.png" alt=""></div>
                    <div class="usernamediv">
                        <span class="iconfont icon-zhanghu"></span>
                        <input class="username" type="text" name="username" placeholder="账户名" autocomplete="off">
                    </div>
                    <div class="passworddiv">
                        <span class="iconfont icon-mima"></span>
                        <input class="password" type="password" name="password" placeholder="密码">
                    </div>
                    <div class="yzmdiv">
                        <span class="iconfont icon-yanzhengma"></span>
                        <input class="yzm" type="text" name="code" placeholder="验证码">
                        <img id="captcha_img" alt="点击更换"  title="点击更换"
                             onclick="changeVerifyCode(this)" src="../Kaptcha"/>
                    </div>
                    <input type="submit" value="登录" class="buttom">
                    <p class="errormsg">${errormsg}</p>
                </form>
            </div>
        </div>
    </div>


</div>
<div class="w announcementbody">
    <div class="announcement_div">
        <span class="wire_left"></span>
        <span class="wire_right"></span>
        <div class="announcement_title">
            <p>公告</p>
            <p>announcement</p>
        </div>
    </div>
    <div class="announcement">
                    <div class="left">
                        <div class="layui-carousel" id="test1">
                            <div carousel-item>
                            <c:forEach items="${lastest}" var="lastest">
                                <div style="background-color: #fff">
                                <!-- 详细公告链接 -->
                                <a href="/mainDetail?notify_id=${lastest.notify_id}">
                                    <!-- 详细公告的标题 -->
                                    <p class="title">${lastest.title}</p>
                                    <!-- 内容 -->
                                    <p class="content">
                                        ${lastest.content}
                                    </p>
                                    <!-- 时间 -->
                                    <p class="time"><fmt:formatDate value="${lastest.create_date}" pattern="yyyy-MM-dd" /></p>
                                </a>
                                </div>
                            </c:forEach>
                            </div>
                        </div>
        </div>
        <span></span>
        <div class="right">
            <c:forEach items="${lastest}" var="lastest">
                    <div class="list">
                        <a href="/mainDetail?notify_id=${lastest.notify_id}">
                            <p>${lastest.title}</p>
                            <p><fmt:formatDate value="${lastest.create_date}" pattern="yyyy-MM-dd" /></p>
                        </a>
                    </div>
            </c:forEach>
        </div>
    </div>
</div>
<div class="foot">
    <p>地址：东莞市松山湖大道大学路一号 邮编：523000 电话：13433634507 邮箱：DGUT-3313@edu.cn</p>
</div>

<script>
    function changeVerifyCode(img) {
        img.src = "../Kaptcha?" + Math.floor(Math.random() * 100);
    }
</script>

<script>
    layui.use('carousel', function(){
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#test'
            ,width: '100%' //设置容器宽度
            ,arrow: 'hover' //始终显示箭头
            //,anim: 'updown' //切换动画方式
        });
        carousel.render({
            elem: '#test1'
            ,width: '100%' //设置容器宽度
            ,arrow: 'hover' //始终显示箭头
            //,anim: 'updown' //切换动画方式
        });
    });


</script>
<%--测试--%>
<script language="JavaScript">
    var logindiv = document.getElementsByClassName("logindiv")[0];
        var msg="<%=session.getAttribute("errormsg")%>";
        // alert(msg);
        console.log(msg)
        if(msg != "null"){
            console.log("jlai");
            logindiv.style.display = "initial";

        }

</script>
</body>
</html>
